package com.demo.springcloud.service;

import com.demo.springcloud.pojo.CommonResult;
import com.demo.springcloud.pojo.Payment;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author chenyuan
 * @date 2020/12/5 16:29
 */
// 注册组件
@Component
// 标注这是一个 Feign 接口, Value 值表示 微服务名称
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
	@GetMapping("/provider/getPaymentById/{id}")
	public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

	@GetMapping(value = "/provider/payment/feign/timeout")
	public String paymentFeignTimeout();
}
